home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2001 Haziran / CHIP Haziran2001.iso / prog / haziran / 20 / setup.exe / {app} / plugins / XQ Windows DOS Prompt.xpl < prev    next >
Encoding:
XSetup plugin  |  2001-03-28  |  2.4 KB  |  80 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="1"
  3. "COUNT"="2"
  4. "UIPATH"="Appearance\System\DOS"
  5. "NAME"="DOS Prompt Config"
  6. "OSVERSION"="10100"
  7. "VERSION"="1.01"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="DOS Prompt"
  10. "TEXT 2"="Windows Prompt"
  11. "DESCRIPTION 1"="To remind yourself that you are running a full screen DOS session from you can use this plug-in."
  12. "DESCRIPTION 2"="The second statement line is what you'll see as prompt during your DOS session (Windows DOS box), and you won't forget to go back to Windows when you're done working/playing in DOS."
  13. "DESCRIPTION 3"="Example DOS Prompt:" 
  14. "DESCRIPTION 4"="MS-DOS Mode!$_$P$G" 
  15. "DESCRIPTION 5"="Example Windows Prompt:"
  16. "DESCRIPTION 6"="Type EXIT & hit ENTER to return to Windows!$_$P$G"
  17. "AUTHOR"="Xteq Systems"
  18. "CONTACTURL"="http://www.xteq.com"
  19. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  20. "COMMENT 1"="Thanks to AXCEL216 for this tip."
  21.  
  22.  
  23. 'Declaration of some constants
  24. sF="C:\AUTOEXEC.BAT"
  25. sV1="SET PROMPT="
  26. sV2="SET WINPMT="
  27.  
  28. 'Called when the Plugin is started
  29. Sub Plugin_Initialize
  30.  Call FileSetAttribute(sF,"R-")
  31.  Call FileSetAttribute(sF,"H-")
  32.  
  33.  TxtOpen(sF)
  34.  
  35.  i=TxtFindLine(sV1,false) 'search for first prompt, ignoring case
  36.  if i>0 then
  37.     s=TxtGetLine(i)
  38.     'strip out the part after the "="
  39.     i=InStr(s,"=")      'find where "=" appears
  40.     s=Right(s,len(s)-i) 'extract the part after the "="
  41.  
  42.     SetUIElement 1,s    'finally, set inside UI
  43.  end if     
  44.  
  45.  i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
  46.  if i>0 then
  47.     s=TxtGetLine(i)
  48.     'strip out the part after the "="
  49.     i=InStr(s,"=")      'find where "=" appears
  50.     s=Right(s,len(s)-i) 'extract the part after the "="
  51.  
  52.     SetUIElement 2,s
  53.  end if     
  54.  
  55. End Sub
  56.  
  57. 'Called when the Plugin should validate the Data the user has entered
  58. Sub Plugin_CheckData(ElementIndex)
  59. End Sub
  60.  
  61. 'Called when the Plugin should apply the changes
  62. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  63.  s=GetUIElement(1)
  64.  i=TxtFindLine(sV1,false) 'search for second prompt, ignoring case
  65.  Call TxtSetLine(i,sV1 & s) 'write to file
  66.  
  67.  s=GetUIElement(2)
  68.  i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
  69.  Call TxtSetLine(i,sV2 & s) 'write to file
  70.  
  71.  Call FileBackup(sF) 'backup file
  72.  Call TxtSave() 'save file
  73. End Sub
  74.  
  75. 'Called when the Plugin is about to be removed from memory
  76. Sub Plugin_Terminate
  77.  Call FileSetAttribute(sF,"H+")
  78. End Sub
  79.  
  80.